<?php
namespace app\admin\logic;
use think\facade\Request;
use think\facade\View;

class Goods
{
    public static function getWhere()
    {
        $param = \think\facade\Request::param();
        $where = [];
        if(isset($param['keywords']) && !empty($param['keywords']))  $where['keywords'] = $param['keywords'];
        if(isset($param['is_show'])  && !empty($param['is_show']))   $where['is_show'] = $param['is_show'];
        if(isset($param['is_hot'])   && !empty($param['is_hot']))    $where['is_hot'] = $param['is_hot'];
        if(isset($param['is_down'])  && !empty($param['is_down']))   $where['is_down'] = $param['is_down'];
        if(isset($param['cid'])      && !empty($param['cid']))       $where['cid'] = $param['cid'];
        \think\facade\View::assign($param);

        return $where;
    }
    public static function getIdd()
    {
        $ids=Request::get('ids');
        return $ids;
    }
    public static function getWhereorder()
    {

        $order = Request::get('order','');
        if (empty($order)){
            $order_data = [
                'order'=>'addtime desc',
                'jt' =>'',
            ];
            View::assign($order_data);
        } elseif ($order=='addtime desc'){
            $order_data = [
                'order'=>'addtime',
                'jt'=>'↓'
            ];
            View::assign($order_data);
        }elseif($order=='addtime'){
            $order_data = [
                'order'=>'id',
                'jt'=>'↑'
            ];
            View::assign($order_data);
        }elseif($order=='id'){
            $order_data = [
                'order'=>'',
                'jt'=>'id↑'
            ];
            View::assign($order_data);

        }
        return  $order;

    }


    public static function getWherecte()
    {

        $pid = Request::get('pid',0);

        return $pid;

    }

}